
#ifndef __TEST_PROTOCOL_ARGS_H__
#define __TEST_PROTOCOL_ARGS_H__

#include "hi_type.h"
#include "hi_svr_player.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */

typedef struct TEST_EVENT
{
	HI_S32	type;
	HI_VOID *Args;
}TEST_EVENT_S;

typedef HI_S32 (*TEST_PROTOCOL_EVENT_FN)(TEST_EVENT_S *pstruEvent);



typedef enum TestCmdType
{
    TEST_CMD_TYPE_NONE=0x0,
    TEST_CMD_TYPE_FILESIZE,
    TEST_CMD_TYPE_CALLBACK,
    TEST_CMD_TYPE_BULT,
}TESTCMDTYPE_E;

typedef struct
{
    HI_S32 s32Cmd;
    TEST_PROTOCOL_EVENT_FN pfnCallback;
    HI_VOID *args;
}TEST_PROTOCOL_ARGS;



typedef struct tagTEST_PRI_FILE_MEMBER_S
{
    HI_S32	fd;
    HI_BOOL bEof;                      /* be end of file */
    HI_S32  s32ReadBytes;
    HI_S64  s32FileSize;
    TEST_PROTOCOL_EVENT_FN pfnCallBack;
} TEST_PRI_FILE_MEMBER_S;

typedef HI_S32 (*FILE_READ_CALL_BACK)(HI_S32 fd, HI_U8 *pdata, HI_U32 u32Size);

typedef HI_S32 (*FILE_OPEN_CALL_BACK)(TEST_PRI_FILE_MEMBER_S *fileDes,HI_U8 *path);

typedef HI_S64 (*FILE_SEEK_CALL_BACK)(HI_S32 fd, HI_S64 s64Offsets, HI_S32 s32Whence);

typedef HI_S32 (*FILE_CLOSE_CALL_BACK)(HI_S32 fd);


//////////////////////////////////////////////////////////////////////////



//////////////////////////////////////////////////////////////////////////

//以下三个函数是文件读取回调函数,用户可以注册回调函数完成自己的文件操作;
//如果不注册,则按照系统默认方式读取;

HI_S32 TDRV_MediaPlayer_RegisterOpenFile(FILE_OPEN_CALL_BACK func);
HI_S32 TDRV_MediaPlayer_RegisterSeekFile(FILE_SEEK_CALL_BACK func);
HI_S32 TDRV_MediaPlayer_RegisterCloseFile(FILE_CLOSE_CALL_BACK func);
HI_S32 TDRV_MediaPlayer_RegisterReadFile(FILE_READ_CALL_BACK func);


//数据解密回调函数, 系统 ReadFile 时会调用此函数;
#define TDRV_MediaPlayerRegisterDecryption	TDRV_MediaPlayer_RegisterReadFile
#define TDRV_MediaPlayer_RigisterOpenFile	TDRV_MediaPlayer_RegisterOpenFile
#define TDRV_MediaPlayer_RigisterSeekFile	TDRV_MediaPlayer_RegisterSeekFile
#define TDRV_MediaPlayer_RigisterCloseFile	TDRV_MediaPlayer_RegisterCloseFile

#define RAW_DATA_Decryption		FILE_READ_CALL_BACK
#define FILE_Open				FILE_OPEN_CALL_BACK
#define FILE_Seek				FILE_SEEK_CALL_BACK
#define FILE_Close				FILE_CLOSE_CALL_BACK



#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */

#endif /* __TEST_PROTOCOL_ARGS_H__ */

